package cn.vc.content.feign.clients.video;

import cn.vc.basicmodule.entity.Result;
import cn.vc.content.entity.video.dto.VideoDto;
import cn.vc.content.entity.video.po.Video;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.*;

@FeignClient(name = "content-service", path = "/content/video")
public interface VideoClient {

    /**
     * <h2>保存视频</h2>
     * @param title
     * @param intro
     * @return
     */
    @PostMapping("/save")
    Result<?> save(@RequestParam String title, @RequestParam String intro, @RequestParam Integer videoTotalTime, /*@RequestParam String communitiesId,*/
                          @RequestParam String coverUrl, @RequestParam Long mediaId);
    /**
     * 审核通过
     */
    @PostMapping("/audit/{id}")
    void passTheAudit(@PathVariable("id") Long id);

    /**
     * 查询所有草稿
     * @return
     */
    @GetMapping("/1")
    List<VideoDto> selectDraft();

    /**
     * <h2>通过ID查询草稿</h2>
     * @return
     */
    @GetMapping("/1/{id}")
    Result<?> selectDraftById(@RequestHeader(value = "token") String token,
                                     @PathVariable("id") String id);
    /**
     * <h2>查询所有视频</h2>
     * @return
     */
    @GetMapping("/2")
    Result<?> selectAll();
    /**
     * <h2>通过ID查询视频</h2>
     * @return
     */
    @GetMapping("/2/{id}")
    Result<?> selectSaveById(@PathVariable("id") Long id);
    /**
     * <h2>通过userId查询视频</h2>
     * @return
     */
    @GetMapping("/3/{id}")
    Result<List<Video>> selectByUserId(@PathVariable("id") Long userId);
    @GetMapping("/4")
    Result<?> selectByTapNum();
}
